﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using DevExpress.Xpf.Core;
using System.Windows;

namespace Cinser.Common.Wpf
{
    public class ShowMessage
    {
        /// <summary>
        /// 未完成功能处的提示
        /// </summary>
        public static void UnFinishNotice()
        {
            DXMessageBox.Show("功能正在构建中,请等待下个版本.", "提示",
                System.Windows.MessageBoxButton.OK,
                System.Windows.MessageBoxImage.Information,
                System.Windows.MessageBoxResult.OK);
        }




        /// <summary>
        /// 提示
        /// </summary>
        /// <param name="notice">提示信息</param>
        public static void Notice(string notice)
        {
            
            DXMessageBox.Show(notice, "提示",
                System.Windows.MessageBoxButton.OK,
                System.Windows.MessageBoxImage.Information,
                System.Windows.MessageBoxResult.OK);
            //System.Windows.Forms.MessageBox.Show(notice, "提示", System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.xmlrmation);
        }

        /// <summary>
        /// 警告
        /// </summary>
        /// <param name="notice"></param>
        public static void Warnning(string notice,FrameworkElement element=null)
        {
            if (element != null)
            {
                element.Dispatcher.Invoke(new Action(() =>
                {
                    DXMessageBox.Show(notice, "警告",
             System.Windows.MessageBoxButton.OK,
             System.Windows.MessageBoxImage.Warning,
             System.Windows.MessageBoxResult.OK);
                }));
            }
            else
            {
                DXMessageBox.Show(notice, "警告",
                          System.Windows.MessageBoxButton.OK,
                          System.Windows.MessageBoxImage.Warning,
                          System.Windows.MessageBoxResult.OK);
            }
            //System.Windows.Forms.MessageBox.Show(notice, "警告", System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Warning);
        }

        /// <summary>
        /// 错误
        /// </summary>
        /// <param name="notic"></param>
        public static void Error(string notice)
        {
            DXMessageBox.Show(notice, "错误",
               System.Windows.MessageBoxButton.OK,
               System.Windows.MessageBoxImage.Error,
               System.Windows.MessageBoxResult.OK);
            //System.Windows.Forms.MessageBox.Show(notice, "错误", System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Error);
        }

        public static void Hand(string notice)
        {
            DXMessageBox.Show(notice, "提示",
                          System.Windows.MessageBoxButton.OK,
                          System.Windows.MessageBoxImage.Hand,
                          System.Windows.MessageBoxResult.OK);
        }

        /// <summary>
        /// 问题(是否)
        /// </summary>
        /// <param name="notice"></param>
        /// <returns></returns>
        public static System.Windows.MessageBoxResult Question_YesNo(string notice)
        {
            return DXMessageBox.Show(notice, "提示",
               System.Windows.MessageBoxButton.YesNo,
               System.Windows.MessageBoxImage.Question,
               System.Windows.MessageBoxResult.Yes);
           // return MessageBox.Show(notice, "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
        }

        /// 问题(是否)
        /// </summary>
        /// <param name="notice"></param>
        /// <returns></returns>
        public static System.Windows.MessageBoxResult Question_OKCancel(string notice)
        {
            return DXMessageBox.Show(notice, "提示",
               System.Windows.MessageBoxButton.OKCancel,
               System.Windows.MessageBoxImage.Question,
               System.Windows.MessageBoxResult.OK);
            // return MessageBox.Show(notice, "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
        }

        /// <summary>
        /// 问题(是否)
        /// </summary>
        /// <param name="notice"></param>
        /// <returns></returns>
        public static System.Windows.MessageBoxResult Question_YesNoCancel(string notice)
        {
            return DXMessageBox.Show(notice, "提示",
               System.Windows.MessageBoxButton.YesNoCancel,
               System.Windows.MessageBoxImage.Question,
               System.Windows.MessageBoxResult.Yes);
            //return MessageBox.Show(notice, "提示", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Question);
        }

    }
}
